package com.hsav.kcxb.utils;

import android.app.Activity;
import android.content.Context;
import android.net.Uri;
import android.widget.ImageView;

import com.bumptech.glide.Glide;

/**
 * Created by zhao on 2017/2/2.
 */

public class ImgLoadUtil {

    public static void setImage(Context context, ImageView imgView, String src, int errorImgId) {
        if (context instanceof Activity) {
            Glide.with((Activity) context).load(Uri.parse(src)).error(errorImgId).into(imgView);
        } else {
            Glide.with(context).load(Uri.parse(src)).error(errorImgId).into(imgView);
        }
    }
}
